package com.andy.blog.common.converter;

import com.alibaba.excel.converters.Converter;
import com.alibaba.excel.metadata.GlobalConfiguration;
import com.alibaba.excel.metadata.data.WriteCellData;
import com.alibaba.excel.metadata.property.ExcelContentProperty;
import com.andy.blog.common.constant.CacheConstants;
import com.andy.blog.common.utils.DictUtils;

/**
 * Created by andy on 2023-04-29 13:02
 */
public class StatusConverter implements Converter<String> {

    /**
     * 将excel的数据类型转为java数据类型
     */
    @Override
    public WriteCellData<?> convertToExcelData(String value, ExcelContentProperty contentProperty,
                                               GlobalConfiguration globalConfiguration) {
        return new WriteCellData<>(DictUtils.getDictLabel(CacheConstants.SYS_NORMAL_DISABLE, value));
    }
}
